<!DOCTYPE html>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<c:set var="simple" value="${result}"></c:set>
<html>
	<head>
		<meta charset="utf-8">
		<title>Welcome</title>
		<script src="${pageContext.request.contextPath}/statics/js/jquery-1.9.0.min.js"></script>
		<script type="text/javascript">
			$(function(){
				$("#jsonp").click(function(){
					 $.ajax({  
			             type: "get",  
			             async: false,  
			             url: "jsonTest.json",  
			             dataType: "jsonp",  
			             success: function(data){  
			                 console.log(data)
			             },  
			             error: function(){  
			                 alert('fail');  
			             }  
			         });
					 
				});	
				
				
				$("#json").click(function(){
					 $.ajax({  
			             type: "get",  
			             async: false,  
			             url: "jsonTest.json",  
			             dataType: "json",  
			             success: function(data){  
			                 console.log(data)
			             },  
			             error: function(){  
			                 alert('fail');  
			             }  
			         });
					 
				});	
			})
		</script>
	</head> 
	<body>
	simple index
		<a id="jsonp">jsonp</a>
		<a id="json">json</a>
		result:
		${result.id}
		${result.name}
		<br>
		simple
		${simple.id}
		${simple.name}
	</body>
</html>
